package router

import (
	"github.com/gin-gonic/gin"
	"go_my_framework/app/core/session"
)

func InitRouter() *gin.Engine {
	r := gin.Default()

	// 注册模板
	r.LoadHTMLGlob("template/**/**/*")

	// 注册静态文件
	r.Static("static", "./static")

	// cookie
	r.Use(session.EnableCookieSession("0102$%#&*^*&150405"))

	//r.Use(middleware.AuthMiddleware)

	AdminRouter(r)
	IndexRouter(r)

	return r
}